#include "Sales_item.h"
#include <iostream>

int main() {
  Sales_item currItem, nextItem;
  int number = 1;
  std::cin >> currItem;
  while (std::cin >> nextItem)
    if (currItem.isbn() == nextItem.isbn()) {
      number++;
      currItem = nextItem;
    } else {
      std::cout << currItem.isbn() << "  has sold note " << number << std::endl;
      number = 1;
      currItem = nextItem;
    }
  //输出最后一条
  std::cout << currItem.isbn() << "  has sold note " << number << std::endl;
  system("pause");
  return 0;
}